﻿#region Using directives

using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using NetROS.Tiers.Entities;
using NetROS.Tiers.Data;

#endregion

namespace NetROS.Tiers.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="VwObracunZaIDProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract class VwObracunZaIDProviderBaseCore : EntityViewProviderBase<VwObracunZaID>
	{
		#region Custom Methods
		
		
		#endregion

		#region Helper Functions
		
		/*
		///<summary>
		/// Fill an VList&lt;VwObracunZaID&gt; From a DataSet
		///</summary>
		/// <param name="dataSet">the DataSet</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Start row</param>
		/// <param name="pagelen">number of row.</param>
		///<returns><see chref="VList&lt;VwObracunZaID&gt;"/></returns>
		protected static VList&lt;VwObracunZaID&gt; Fill(DataSet dataSet, VList<VwObracunZaID> rows, int start, int pagelen)
		{
			if (dataSet.Tables.Count == 1)
			{
				return Fill(dataSet.Tables[0], rows, start, pagelen);
			}
			else
			{
				return new VList<VwObracunZaID>();
			}	
		}
		
		
		///<summary>
		/// Fill an VList&lt;VwObracunZaID&gt; From a DataTable
		///</summary>
		/// <param name="dataTable">the DataTable that hold the data.</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Start row</param>
		/// <param name="pagelen">number of row.</param>
		///<returns><see chref="VList<VwObracunZaID>"/></returns>
		protected static VList&lt;VwObracunZaID&gt; Fill(DataTable dataTable, VList<VwObracunZaID> rows, int start, int pagelen)
		{
			int recordnum = 0;
			
			System.Collections.IEnumerator dataRows =  dataTable.Rows.GetEnumerator();
			
			while (dataRows.MoveNext() && (pagelen != 0))
			{
				if(recordnum >= start)
				{
					DataRow row = (DataRow)dataRows.Current;
				
					VwObracunZaID c = new VwObracunZaID();
					c.IDObracun = (Convert.IsDBNull(row["IDObracun"]))?(int)0:(System.Int32)row["IDObracun"];
					c.Naziv = (Convert.IsDBNull(row["Naziv"]))?string.Empty:(System.String)row["Naziv"];
					c.Sjediste = (Convert.IsDBNull(row["Sjediste"]))?string.Empty:(System.String)row["Sjediste"];
					c.IPPU = (Convert.IsDBNull(row["IPPU"]))?string.Empty:(System.String)row["IPPU"];
					c.IBObveznika = (Convert.IsDBNull(row["IBObveznika"]))?string.Empty:(System.String)row["IBObveznika"];
					c.IdentifikatorIDNaziv = (Convert.IsDBNull(row["IdentifikatorIDNaziv"]))?string.Empty:(System.String)row["IdentifikatorIDNaziv"];
					c.IdentifikatorIDSifra = (Convert.IsDBNull(row["IdentifikatorIDSifra"]))?string.Empty:(System.String)row["IdentifikatorIDSifra"];
					c.RSMVrstaObracunaOpis = (Convert.IsDBNull(row["RSMVrstaObracunaOpis"]))?string.Empty:(System.String)row["RSMVrstaObracunaOpis"];
					c.RSMVrstaObracunaSifra = (Convert.IsDBNull(row["RSMVrstaObracunaSifra"]))?string.Empty:(System.String)row["RSMVrstaObracunaSifra"];
					c.RSMVrstaObveznikaOpis = (Convert.IsDBNull(row["RSMVrstaObveznikaOpis"]))?string.Empty:(System.String)row["RSMVrstaObveznikaOpis"];
					c.RSMVrstaObveznikaSifra = (Convert.IsDBNull(row["RSMVrstaObveznikaSifra"]))?string.Empty:(System.String)row["RSMVrstaObveznikaSifra"];
					c.UkBrojStranica = (Convert.IsDBNull(row["UkBrojStranica"]))?(long)0:(System.Int64?)row["UkBrojStranica"];
					c.UkBrojOsoba = (Convert.IsDBNull(row["UkBrojOsoba"]))?(long)0:(System.Int64?)row["UkBrojOsoba"];
					c.IsplaceniPrimici = (Convert.IsDBNull(row["IsplaceniPrimici"]))?0:(System.Decimal?)row["IsplaceniPrimici"];
					c.OsnovicaZaIzracundoprinosa = (Convert.IsDBNull(row["OsnovicaZaIzracundoprinosa"]))?0:(System.Decimal?)row["OsnovicaZaIzracundoprinosa"];
					c.MIO1 = (Convert.IsDBNull(row["MIO1"]))?0:(System.Decimal?)row["MIO1"];
					c.MIO2 = (Convert.IsDBNull(row["MIO2"]))?0:(System.Decimal?)row["MIO2"];
					c.Dohodak = (Convert.IsDBNull(row["Dohodak"]))?0:(System.Decimal?)row["Dohodak"];
					c.OsobniOdbici = (Convert.IsDBNull(row["OsobniOdbici"]))?0:(System.Decimal?)row["OsobniOdbici"];
					c.PorOsnovica = (Convert.IsDBNull(row["PorOsnovica"]))?0:(System.Decimal?)row["PorOsnovica"];
					c.ObracunatPorezIPrirez = (Convert.IsDBNull(row["ObracunatPorezIPrirez"]))?0:(System.Decimal?)row["ObracunatPorezIPrirez"];
					c.ObracunatPorez = (Convert.IsDBNull(row["ObracunatPorez"]))?0:(System.Decimal?)row["ObracunatPorez"];
					c.ObracunatPrirez = (Convert.IsDBNull(row["ObracunatPrirez"]))?0:(System.Decimal?)row["ObracunatPrirez"];
					c.BrojRadnika = (Convert.IsDBNull(row["BrojRadnika"]))?(int)0:(System.Int32?)row["BrojRadnika"];
					c.MIO1Osnovno = (Convert.IsDBNull(row["MIO1Osnovno"]))?0:(System.Decimal?)row["MIO1Osnovno"];
					c.MIO1Povecano = (Convert.IsDBNull(row["MIO1Povecano"]))?0:(System.Decimal?)row["MIO1Povecano"];
					c.MIO2Osnovno = (Convert.IsDBNull(row["MIO2Osnovno"]))?0:(System.Decimal?)row["MIO2Osnovno"];
					c.MIO2Povecano = (Convert.IsDBNull(row["MIO2Povecano"]))?0:(System.Decimal?)row["MIO2Povecano"];
					c.Zdrav = (Convert.IsDBNull(row["Zdrav"]))?0:(System.Decimal?)row["Zdrav"];
					c.ZastitaNaRadu = (Convert.IsDBNull(row["ZastitaNaRadu"]))?0:(System.Decimal?)row["ZastitaNaRadu"];
					c.Zaposljavanje = (Convert.IsDBNull(row["Zaposljavanje"]))?0:(System.Decimal?)row["Zaposljavanje"];
					c.Invaliditet = (Convert.IsDBNull(row["Invaliditet"]))?0:(System.Decimal?)row["Invaliditet"];
					c.ZdrInozemstvo = (Convert.IsDBNull(row["ZdrInozemstvo"]))?0:(System.Decimal?)row["ZdrInozemstvo"];
					c.UkNetoPredPosPorez = (Convert.IsDBNull(row["UkNetoPredPosPorez"]))?0:(System.Decimal?)row["UkNetoPredPosPorez"];
					c.UkNetoIsplata = (Convert.IsDBNull(row["UkNetoIsplata"]))?0:(System.Decimal?)row["UkNetoIsplata"];
					c.UkPosPorez = (Convert.IsDBNull(row["UkPosPorez"]))?0:(System.Decimal?)row["UkPosPorez"];
					c.DatumIsplate = (Convert.IsDBNull(row["DatumIsplate"]))?DateTime.MinValue:(System.DateTime)row["DatumIsplate"];
					c.DatumOd = (Convert.IsDBNull(row["DatumOd"]))?DateTime.MinValue:(System.DateTime)row["DatumOd"];
					c.DatumDo = (Convert.IsDBNull(row["DatumDo"]))?DateTime.MinValue:(System.DateTime)row["DatumDo"];
					c.RedniBrojUGodini = (Convert.IsDBNull(row["RedniBrojUGodini"]))?(int)0:(System.Int32)row["RedniBrojUGodini"];
					c.ObracunMjesec = (Convert.IsDBNull(row["ObracunMjesec"]))?(int)0:(System.Int32?)row["ObracunMjesec"];
					c.ObracunGodina = (Convert.IsDBNull(row["ObracunGodina"]))?(int)0:(System.Int32?)row["ObracunGodina"];
					c.IsplataMjesec = (Convert.IsDBNull(row["IsplataMjesec"]))?(int)0:(System.Int32?)row["IsplataMjesec"];
					c.IsplataGodina = (Convert.IsDBNull(row["IsplataGodina"]))?(int)0:(System.Int32?)row["IsplataGodina"];
					c.RSMSHA = (Convert.IsDBNull(row["RSMSHA"]))?string.Empty:(System.String)row["RSMSHA"];
					c.BrojOsobaSPosPorezom = (Convert.IsDBNull(row["BrojOsobaSPosPorezom"]))?(int)0:(System.Int32?)row["BrojOsobaSPosPorezom"];
					c.PorOsnovicaPosPorez = (Convert.IsDBNull(row["PorOsnovicaPosPorez"]))?0:(System.Decimal?)row["PorOsnovicaPosPorez"];
					c.AcceptChanges();
					rows.Add(c);
					pagelen -= 1;
				}
				recordnum += 1;
			}
			return rows;
		}
		*/	
						
		///<summary>
		/// Fill an <see cref="VList&lt;VwObracunZaID&gt;"/> From a DataReader.
		///</summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Start row</param>
		/// <param name="pageLength">number of row.</param>
		///<returns>a <see cref="VList&lt;VwObracunZaID&gt;"/></returns>
		protected VList<VwObracunZaID> Fill(IDataReader reader, VList<VwObracunZaID> rows, int start, int pageLength)
		{
			int recordnum = 0;
			while (reader.Read() && (pageLength != 0))
			{
				if(recordnum >= start)
				{
					VwObracunZaID entity = null;
					if (DataRepository.Provider.UseEntityFactory)
					{
						entity = EntityManager.CreateViewEntity<VwObracunZaID>("VwObracunZaID",  DataRepository.Provider.EntityCreationalFactoryType); 
					}
					else
					{
						entity = new VwObracunZaID();
					}
					entity.IDObracun = (System.Int32)reader["IDObracun"];
					//entity.IDObracun = (Convert.IsDBNull(reader["IDObracun"]))?(int)0:(System.Int32)reader["IDObracun"];
					entity.Naziv = reader.IsDBNull(reader.GetOrdinal("Naziv")) ? null : (System.String)reader["Naziv"];
					//entity.Naziv = (Convert.IsDBNull(reader["Naziv"]))?string.Empty:(System.String)reader["Naziv"];
					entity.Sjediste = reader.IsDBNull(reader.GetOrdinal("Sjediste")) ? null : (System.String)reader["Sjediste"];
					//entity.Sjediste = (Convert.IsDBNull(reader["Sjediste"]))?string.Empty:(System.String)reader["Sjediste"];
					entity.IPPU = reader.IsDBNull(reader.GetOrdinal("IPPU")) ? null : (System.String)reader["IPPU"];
					//entity.IPPU = (Convert.IsDBNull(reader["IPPU"]))?string.Empty:(System.String)reader["IPPU"];
					entity.IBObveznika = reader.IsDBNull(reader.GetOrdinal("IBObveznika")) ? null : (System.String)reader["IBObveznika"];
					//entity.IBObveznika = (Convert.IsDBNull(reader["IBObveznika"]))?string.Empty:(System.String)reader["IBObveznika"];
					entity.IdentifikatorIDNaziv = reader.IsDBNull(reader.GetOrdinal("IdentifikatorIDNaziv")) ? null : (System.String)reader["IdentifikatorIDNaziv"];
					//entity.IdentifikatorIDNaziv = (Convert.IsDBNull(reader["IdentifikatorIDNaziv"]))?string.Empty:(System.String)reader["IdentifikatorIDNaziv"];
					entity.IdentifikatorIDSifra = reader.IsDBNull(reader.GetOrdinal("IdentifikatorIDSifra")) ? null : (System.String)reader["IdentifikatorIDSifra"];
					//entity.IdentifikatorIDSifra = (Convert.IsDBNull(reader["IdentifikatorIDSifra"]))?string.Empty:(System.String)reader["IdentifikatorIDSifra"];
					entity.RSMVrstaObracunaOpis = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObracunaOpis")) ? null : (System.String)reader["RSMVrstaObracunaOpis"];
					//entity.RSMVrstaObracunaOpis = (Convert.IsDBNull(reader["RSMVrstaObracunaOpis"]))?string.Empty:(System.String)reader["RSMVrstaObracunaOpis"];
					entity.RSMVrstaObracunaSifra = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObracunaSifra")) ? null : (System.String)reader["RSMVrstaObracunaSifra"];
					//entity.RSMVrstaObracunaSifra = (Convert.IsDBNull(reader["RSMVrstaObracunaSifra"]))?string.Empty:(System.String)reader["RSMVrstaObracunaSifra"];
					entity.RSMVrstaObveznikaOpis = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObveznikaOpis")) ? null : (System.String)reader["RSMVrstaObveznikaOpis"];
					//entity.RSMVrstaObveznikaOpis = (Convert.IsDBNull(reader["RSMVrstaObveznikaOpis"]))?string.Empty:(System.String)reader["RSMVrstaObveznikaOpis"];
					entity.RSMVrstaObveznikaSifra = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObveznikaSifra")) ? null : (System.String)reader["RSMVrstaObveznikaSifra"];
					//entity.RSMVrstaObveznikaSifra = (Convert.IsDBNull(reader["RSMVrstaObveznikaSifra"]))?string.Empty:(System.String)reader["RSMVrstaObveznikaSifra"];
					entity.UkBrojStranica = reader.IsDBNull(reader.GetOrdinal("UkBrojStranica")) ? null : (System.Int64?)reader["UkBrojStranica"];
					//entity.UkBrojStranica = (Convert.IsDBNull(reader["UkBrojStranica"]))?(long)0:(System.Int64?)reader["UkBrojStranica"];
					entity.UkBrojOsoba = reader.IsDBNull(reader.GetOrdinal("UkBrojOsoba")) ? null : (System.Int64?)reader["UkBrojOsoba"];
					//entity.UkBrojOsoba = (Convert.IsDBNull(reader["UkBrojOsoba"]))?(long)0:(System.Int64?)reader["UkBrojOsoba"];
					entity.IsplaceniPrimici = reader.IsDBNull(reader.GetOrdinal("IsplaceniPrimici")) ? null : (System.Decimal?)reader["IsplaceniPrimici"];
					//entity.IsplaceniPrimici = (Convert.IsDBNull(reader["IsplaceniPrimici"]))?0:(System.Decimal?)reader["IsplaceniPrimici"];
					entity.OsnovicaZaIzracundoprinosa = reader.IsDBNull(reader.GetOrdinal("OsnovicaZaIzracundoprinosa")) ? null : (System.Decimal?)reader["OsnovicaZaIzracundoprinosa"];
					//entity.OsnovicaZaIzracundoprinosa = (Convert.IsDBNull(reader["OsnovicaZaIzracundoprinosa"]))?0:(System.Decimal?)reader["OsnovicaZaIzracundoprinosa"];
					entity.MIO1 = reader.IsDBNull(reader.GetOrdinal("MIO1")) ? null : (System.Decimal?)reader["MIO1"];
					//entity.MIO1 = (Convert.IsDBNull(reader["MIO1"]))?0:(System.Decimal?)reader["MIO1"];
					entity.MIO2 = reader.IsDBNull(reader.GetOrdinal("MIO2")) ? null : (System.Decimal?)reader["MIO2"];
					//entity.MIO2 = (Convert.IsDBNull(reader["MIO2"]))?0:(System.Decimal?)reader["MIO2"];
					entity.Dohodak = reader.IsDBNull(reader.GetOrdinal("Dohodak")) ? null : (System.Decimal?)reader["Dohodak"];
					//entity.Dohodak = (Convert.IsDBNull(reader["Dohodak"]))?0:(System.Decimal?)reader["Dohodak"];
					entity.OsobniOdbici = reader.IsDBNull(reader.GetOrdinal("OsobniOdbici")) ? null : (System.Decimal?)reader["OsobniOdbici"];
					//entity.OsobniOdbici = (Convert.IsDBNull(reader["OsobniOdbici"]))?0:(System.Decimal?)reader["OsobniOdbici"];
					entity.PorOsnovica = reader.IsDBNull(reader.GetOrdinal("PorOsnovica")) ? null : (System.Decimal?)reader["PorOsnovica"];
					//entity.PorOsnovica = (Convert.IsDBNull(reader["PorOsnovica"]))?0:(System.Decimal?)reader["PorOsnovica"];
					entity.ObracunatPorezIPrirez = reader.IsDBNull(reader.GetOrdinal("ObracunatPorezIPrirez")) ? null : (System.Decimal?)reader["ObracunatPorezIPrirez"];
					//entity.ObracunatPorezIPrirez = (Convert.IsDBNull(reader["ObracunatPorezIPrirez"]))?0:(System.Decimal?)reader["ObracunatPorezIPrirez"];
					entity.ObracunatPorez = reader.IsDBNull(reader.GetOrdinal("ObracunatPorez")) ? null : (System.Decimal?)reader["ObracunatPorez"];
					//entity.ObracunatPorez = (Convert.IsDBNull(reader["ObracunatPorez"]))?0:(System.Decimal?)reader["ObracunatPorez"];
					entity.ObracunatPrirez = reader.IsDBNull(reader.GetOrdinal("ObracunatPrirez")) ? null : (System.Decimal?)reader["ObracunatPrirez"];
					//entity.ObracunatPrirez = (Convert.IsDBNull(reader["ObracunatPrirez"]))?0:(System.Decimal?)reader["ObracunatPrirez"];
					entity.BrojRadnika = reader.IsDBNull(reader.GetOrdinal("BrojRadnika")) ? null : (System.Int32?)reader["BrojRadnika"];
					//entity.BrojRadnika = (Convert.IsDBNull(reader["BrojRadnika"]))?(int)0:(System.Int32?)reader["BrojRadnika"];
					entity.MIO1Osnovno = reader.IsDBNull(reader.GetOrdinal("MIO1Osnovno")) ? null : (System.Decimal?)reader["MIO1Osnovno"];
					//entity.MIO1Osnovno = (Convert.IsDBNull(reader["MIO1Osnovno"]))?0:(System.Decimal?)reader["MIO1Osnovno"];
					entity.MIO1Povecano = reader.IsDBNull(reader.GetOrdinal("MIO1Povecano")) ? null : (System.Decimal?)reader["MIO1Povecano"];
					//entity.MIO1Povecano = (Convert.IsDBNull(reader["MIO1Povecano"]))?0:(System.Decimal?)reader["MIO1Povecano"];
					entity.MIO2Osnovno = reader.IsDBNull(reader.GetOrdinal("MIO2Osnovno")) ? null : (System.Decimal?)reader["MIO2Osnovno"];
					//entity.MIO2Osnovno = (Convert.IsDBNull(reader["MIO2Osnovno"]))?0:(System.Decimal?)reader["MIO2Osnovno"];
					entity.MIO2Povecano = reader.IsDBNull(reader.GetOrdinal("MIO2Povecano")) ? null : (System.Decimal?)reader["MIO2Povecano"];
					//entity.MIO2Povecano = (Convert.IsDBNull(reader["MIO2Povecano"]))?0:(System.Decimal?)reader["MIO2Povecano"];
					entity.Zdrav = reader.IsDBNull(reader.GetOrdinal("Zdrav")) ? null : (System.Decimal?)reader["Zdrav"];
					//entity.Zdrav = (Convert.IsDBNull(reader["Zdrav"]))?0:(System.Decimal?)reader["Zdrav"];
					entity.ZastitaNaRadu = reader.IsDBNull(reader.GetOrdinal("ZastitaNaRadu")) ? null : (System.Decimal?)reader["ZastitaNaRadu"];
					//entity.ZastitaNaRadu = (Convert.IsDBNull(reader["ZastitaNaRadu"]))?0:(System.Decimal?)reader["ZastitaNaRadu"];
					entity.Zaposljavanje = reader.IsDBNull(reader.GetOrdinal("Zaposljavanje")) ? null : (System.Decimal?)reader["Zaposljavanje"];
					//entity.Zaposljavanje = (Convert.IsDBNull(reader["Zaposljavanje"]))?0:(System.Decimal?)reader["Zaposljavanje"];
					entity.Invaliditet = reader.IsDBNull(reader.GetOrdinal("Invaliditet")) ? null : (System.Decimal?)reader["Invaliditet"];
					//entity.Invaliditet = (Convert.IsDBNull(reader["Invaliditet"]))?0:(System.Decimal?)reader["Invaliditet"];
					entity.ZdrInozemstvo = reader.IsDBNull(reader.GetOrdinal("ZdrInozemstvo")) ? null : (System.Decimal?)reader["ZdrInozemstvo"];
					//entity.ZdrInozemstvo = (Convert.IsDBNull(reader["ZdrInozemstvo"]))?0:(System.Decimal?)reader["ZdrInozemstvo"];
					entity.UkNetoPredPosPorez = reader.IsDBNull(reader.GetOrdinal("UkNetoPredPosPorez")) ? null : (System.Decimal?)reader["UkNetoPredPosPorez"];
					//entity.UkNetoPredPosPorez = (Convert.IsDBNull(reader["UkNetoPredPosPorez"]))?0:(System.Decimal?)reader["UkNetoPredPosPorez"];
					entity.UkNetoIsplata = reader.IsDBNull(reader.GetOrdinal("UkNetoIsplata")) ? null : (System.Decimal?)reader["UkNetoIsplata"];
					//entity.UkNetoIsplata = (Convert.IsDBNull(reader["UkNetoIsplata"]))?0:(System.Decimal?)reader["UkNetoIsplata"];
					entity.UkPosPorez = reader.IsDBNull(reader.GetOrdinal("UkPosPorez")) ? null : (System.Decimal?)reader["UkPosPorez"];
					//entity.UkPosPorez = (Convert.IsDBNull(reader["UkPosPorez"]))?0:(System.Decimal?)reader["UkPosPorez"];
					entity.DatumIsplate = (System.DateTime)reader["DatumIsplate"];
					//entity.DatumIsplate = (Convert.IsDBNull(reader["DatumIsplate"]))?DateTime.MinValue:(System.DateTime)reader["DatumIsplate"];
					entity.DatumOd = (System.DateTime)reader["DatumOd"];
					//entity.DatumOd = (Convert.IsDBNull(reader["DatumOd"]))?DateTime.MinValue:(System.DateTime)reader["DatumOd"];
					entity.DatumDo = (System.DateTime)reader["DatumDo"];
					//entity.DatumDo = (Convert.IsDBNull(reader["DatumDo"]))?DateTime.MinValue:(System.DateTime)reader["DatumDo"];
					entity.RedniBrojUGodini = (System.Int32)reader["RedniBrojUGodini"];
					//entity.RedniBrojUGodini = (Convert.IsDBNull(reader["RedniBrojUGodini"]))?(int)0:(System.Int32)reader["RedniBrojUGodini"];
					entity.ObracunMjesec = reader.IsDBNull(reader.GetOrdinal("ObracunMjesec")) ? null : (System.Int32?)reader["ObracunMjesec"];
					//entity.ObracunMjesec = (Convert.IsDBNull(reader["ObracunMjesec"]))?(int)0:(System.Int32?)reader["ObracunMjesec"];
					entity.ObracunGodina = reader.IsDBNull(reader.GetOrdinal("ObracunGodina")) ? null : (System.Int32?)reader["ObracunGodina"];
					//entity.ObracunGodina = (Convert.IsDBNull(reader["ObracunGodina"]))?(int)0:(System.Int32?)reader["ObracunGodina"];
					entity.IsplataMjesec = reader.IsDBNull(reader.GetOrdinal("IsplataMjesec")) ? null : (System.Int32?)reader["IsplataMjesec"];
					//entity.IsplataMjesec = (Convert.IsDBNull(reader["IsplataMjesec"]))?(int)0:(System.Int32?)reader["IsplataMjesec"];
					entity.IsplataGodina = reader.IsDBNull(reader.GetOrdinal("IsplataGodina")) ? null : (System.Int32?)reader["IsplataGodina"];
					//entity.IsplataGodina = (Convert.IsDBNull(reader["IsplataGodina"]))?(int)0:(System.Int32?)reader["IsplataGodina"];
					entity.RSMSHA = reader.IsDBNull(reader.GetOrdinal("RSMSHA")) ? null : (System.String)reader["RSMSHA"];
					//entity.RSMSHA = (Convert.IsDBNull(reader["RSMSHA"]))?string.Empty:(System.String)reader["RSMSHA"];
					entity.BrojOsobaSPosPorezom = reader.IsDBNull(reader.GetOrdinal("BrojOsobaSPosPorezom")) ? null : (System.Int32?)reader["BrojOsobaSPosPorezom"];
					//entity.BrojOsobaSPosPorezom = (Convert.IsDBNull(reader["BrojOsobaSPosPorezom"]))?(int)0:(System.Int32?)reader["BrojOsobaSPosPorezom"];
					entity.PorOsnovicaPosPorez = reader.IsDBNull(reader.GetOrdinal("PorOsnovicaPosPorez")) ? null : (System.Decimal?)reader["PorOsnovicaPosPorez"];
					//entity.PorOsnovicaPosPorez = (Convert.IsDBNull(reader["PorOsnovicaPosPorez"]))?0:(System.Decimal?)reader["PorOsnovicaPosPorez"];
					entity.AcceptChanges();
					rows.Add(entity);
					pageLength -= 1;
				}
				recordnum += 1;
			}
			return rows;
		}
		
		
		/// <summary>
		/// Refreshes the <see cref="VwObracunZaID"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="VwObracunZaID"/> object to refresh.</param>
		protected void RefreshEntity(IDataReader reader, VwObracunZaID entity)
		{
			reader.Read();
			entity.IDObracun = (System.Int32)reader["IDObracun"];
			//entity.IDObracun = (Convert.IsDBNull(reader["IDObracun"]))?(int)0:(System.Int32)reader["IDObracun"];
			entity.Naziv = reader.IsDBNull(reader.GetOrdinal("Naziv")) ? null : (System.String)reader["Naziv"];
			//entity.Naziv = (Convert.IsDBNull(reader["Naziv"]))?string.Empty:(System.String)reader["Naziv"];
			entity.Sjediste = reader.IsDBNull(reader.GetOrdinal("Sjediste")) ? null : (System.String)reader["Sjediste"];
			//entity.Sjediste = (Convert.IsDBNull(reader["Sjediste"]))?string.Empty:(System.String)reader["Sjediste"];
			entity.IPPU = reader.IsDBNull(reader.GetOrdinal("IPPU")) ? null : (System.String)reader["IPPU"];
			//entity.IPPU = (Convert.IsDBNull(reader["IPPU"]))?string.Empty:(System.String)reader["IPPU"];
			entity.IBObveznika = reader.IsDBNull(reader.GetOrdinal("IBObveznika")) ? null : (System.String)reader["IBObveznika"];
			//entity.IBObveznika = (Convert.IsDBNull(reader["IBObveznika"]))?string.Empty:(System.String)reader["IBObveznika"];
			entity.IdentifikatorIDNaziv = reader.IsDBNull(reader.GetOrdinal("IdentifikatorIDNaziv")) ? null : (System.String)reader["IdentifikatorIDNaziv"];
			//entity.IdentifikatorIDNaziv = (Convert.IsDBNull(reader["IdentifikatorIDNaziv"]))?string.Empty:(System.String)reader["IdentifikatorIDNaziv"];
			entity.IdentifikatorIDSifra = reader.IsDBNull(reader.GetOrdinal("IdentifikatorIDSifra")) ? null : (System.String)reader["IdentifikatorIDSifra"];
			//entity.IdentifikatorIDSifra = (Convert.IsDBNull(reader["IdentifikatorIDSifra"]))?string.Empty:(System.String)reader["IdentifikatorIDSifra"];
			entity.RSMVrstaObracunaOpis = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObracunaOpis")) ? null : (System.String)reader["RSMVrstaObracunaOpis"];
			//entity.RSMVrstaObracunaOpis = (Convert.IsDBNull(reader["RSMVrstaObracunaOpis"]))?string.Empty:(System.String)reader["RSMVrstaObracunaOpis"];
			entity.RSMVrstaObracunaSifra = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObracunaSifra")) ? null : (System.String)reader["RSMVrstaObracunaSifra"];
			//entity.RSMVrstaObracunaSifra = (Convert.IsDBNull(reader["RSMVrstaObracunaSifra"]))?string.Empty:(System.String)reader["RSMVrstaObracunaSifra"];
			entity.RSMVrstaObveznikaOpis = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObveznikaOpis")) ? null : (System.String)reader["RSMVrstaObveznikaOpis"];
			//entity.RSMVrstaObveznikaOpis = (Convert.IsDBNull(reader["RSMVrstaObveznikaOpis"]))?string.Empty:(System.String)reader["RSMVrstaObveznikaOpis"];
			entity.RSMVrstaObveznikaSifra = reader.IsDBNull(reader.GetOrdinal("RSMVrstaObveznikaSifra")) ? null : (System.String)reader["RSMVrstaObveznikaSifra"];
			//entity.RSMVrstaObveznikaSifra = (Convert.IsDBNull(reader["RSMVrstaObveznikaSifra"]))?string.Empty:(System.String)reader["RSMVrstaObveznikaSifra"];
			entity.UkBrojStranica = reader.IsDBNull(reader.GetOrdinal("UkBrojStranica")) ? null : (System.Int64?)reader["UkBrojStranica"];
			//entity.UkBrojStranica = (Convert.IsDBNull(reader["UkBrojStranica"]))?(long)0:(System.Int64?)reader["UkBrojStranica"];
			entity.UkBrojOsoba = reader.IsDBNull(reader.GetOrdinal("UkBrojOsoba")) ? null : (System.Int64?)reader["UkBrojOsoba"];
			//entity.UkBrojOsoba = (Convert.IsDBNull(reader["UkBrojOsoba"]))?(long)0:(System.Int64?)reader["UkBrojOsoba"];
			entity.IsplaceniPrimici = reader.IsDBNull(reader.GetOrdinal("IsplaceniPrimici")) ? null : (System.Decimal?)reader["IsplaceniPrimici"];
			//entity.IsplaceniPrimici = (Convert.IsDBNull(reader["IsplaceniPrimici"]))?0:(System.Decimal?)reader["IsplaceniPrimici"];
			entity.OsnovicaZaIzracundoprinosa = reader.IsDBNull(reader.GetOrdinal("OsnovicaZaIzracundoprinosa")) ? null : (System.Decimal?)reader["OsnovicaZaIzracundoprinosa"];
			//entity.OsnovicaZaIzracundoprinosa = (Convert.IsDBNull(reader["OsnovicaZaIzracundoprinosa"]))?0:(System.Decimal?)reader["OsnovicaZaIzracundoprinosa"];
			entity.MIO1 = reader.IsDBNull(reader.GetOrdinal("MIO1")) ? null : (System.Decimal?)reader["MIO1"];
			//entity.MIO1 = (Convert.IsDBNull(reader["MIO1"]))?0:(System.Decimal?)reader["MIO1"];
			entity.MIO2 = reader.IsDBNull(reader.GetOrdinal("MIO2")) ? null : (System.Decimal?)reader["MIO2"];
			//entity.MIO2 = (Convert.IsDBNull(reader["MIO2"]))?0:(System.Decimal?)reader["MIO2"];
			entity.Dohodak = reader.IsDBNull(reader.GetOrdinal("Dohodak")) ? null : (System.Decimal?)reader["Dohodak"];
			//entity.Dohodak = (Convert.IsDBNull(reader["Dohodak"]))?0:(System.Decimal?)reader["Dohodak"];
			entity.OsobniOdbici = reader.IsDBNull(reader.GetOrdinal("OsobniOdbici")) ? null : (System.Decimal?)reader["OsobniOdbici"];
			//entity.OsobniOdbici = (Convert.IsDBNull(reader["OsobniOdbici"]))?0:(System.Decimal?)reader["OsobniOdbici"];
			entity.PorOsnovica = reader.IsDBNull(reader.GetOrdinal("PorOsnovica")) ? null : (System.Decimal?)reader["PorOsnovica"];
			//entity.PorOsnovica = (Convert.IsDBNull(reader["PorOsnovica"]))?0:(System.Decimal?)reader["PorOsnovica"];
			entity.ObracunatPorezIPrirez = reader.IsDBNull(reader.GetOrdinal("ObracunatPorezIPrirez")) ? null : (System.Decimal?)reader["ObracunatPorezIPrirez"];
			//entity.ObracunatPorezIPrirez = (Convert.IsDBNull(reader["ObracunatPorezIPrirez"]))?0:(System.Decimal?)reader["ObracunatPorezIPrirez"];
			entity.ObracunatPorez = reader.IsDBNull(reader.GetOrdinal("ObracunatPorez")) ? null : (System.Decimal?)reader["ObracunatPorez"];
			//entity.ObracunatPorez = (Convert.IsDBNull(reader["ObracunatPorez"]))?0:(System.Decimal?)reader["ObracunatPorez"];
			entity.ObracunatPrirez = reader.IsDBNull(reader.GetOrdinal("ObracunatPrirez")) ? null : (System.Decimal?)reader["ObracunatPrirez"];
			//entity.ObracunatPrirez = (Convert.IsDBNull(reader["ObracunatPrirez"]))?0:(System.Decimal?)reader["ObracunatPrirez"];
			entity.BrojRadnika = reader.IsDBNull(reader.GetOrdinal("BrojRadnika")) ? null : (System.Int32?)reader["BrojRadnika"];
			//entity.BrojRadnika = (Convert.IsDBNull(reader["BrojRadnika"]))?(int)0:(System.Int32?)reader["BrojRadnika"];
			entity.MIO1Osnovno = reader.IsDBNull(reader.GetOrdinal("MIO1Osnovno")) ? null : (System.Decimal?)reader["MIO1Osnovno"];
			//entity.MIO1Osnovno = (Convert.IsDBNull(reader["MIO1Osnovno"]))?0:(System.Decimal?)reader["MIO1Osnovno"];
			entity.MIO1Povecano = reader.IsDBNull(reader.GetOrdinal("MIO1Povecano")) ? null : (System.Decimal?)reader["MIO1Povecano"];
			//entity.MIO1Povecano = (Convert.IsDBNull(reader["MIO1Povecano"]))?0:(System.Decimal?)reader["MIO1Povecano"];
			entity.MIO2Osnovno = reader.IsDBNull(reader.GetOrdinal("MIO2Osnovno")) ? null : (System.Decimal?)reader["MIO2Osnovno"];
			//entity.MIO2Osnovno = (Convert.IsDBNull(reader["MIO2Osnovno"]))?0:(System.Decimal?)reader["MIO2Osnovno"];
			entity.MIO2Povecano = reader.IsDBNull(reader.GetOrdinal("MIO2Povecano")) ? null : (System.Decimal?)reader["MIO2Povecano"];
			//entity.MIO2Povecano = (Convert.IsDBNull(reader["MIO2Povecano"]))?0:(System.Decimal?)reader["MIO2Povecano"];
			entity.Zdrav = reader.IsDBNull(reader.GetOrdinal("Zdrav")) ? null : (System.Decimal?)reader["Zdrav"];
			//entity.Zdrav = (Convert.IsDBNull(reader["Zdrav"]))?0:(System.Decimal?)reader["Zdrav"];
			entity.ZastitaNaRadu = reader.IsDBNull(reader.GetOrdinal("ZastitaNaRadu")) ? null : (System.Decimal?)reader["ZastitaNaRadu"];
			//entity.ZastitaNaRadu = (Convert.IsDBNull(reader["ZastitaNaRadu"]))?0:(System.Decimal?)reader["ZastitaNaRadu"];
			entity.Zaposljavanje = reader.IsDBNull(reader.GetOrdinal("Zaposljavanje")) ? null : (System.Decimal?)reader["Zaposljavanje"];
			//entity.Zaposljavanje = (Convert.IsDBNull(reader["Zaposljavanje"]))?0:(System.Decimal?)reader["Zaposljavanje"];
			entity.Invaliditet = reader.IsDBNull(reader.GetOrdinal("Invaliditet")) ? null : (System.Decimal?)reader["Invaliditet"];
			//entity.Invaliditet = (Convert.IsDBNull(reader["Invaliditet"]))?0:(System.Decimal?)reader["Invaliditet"];
			entity.ZdrInozemstvo = reader.IsDBNull(reader.GetOrdinal("ZdrInozemstvo")) ? null : (System.Decimal?)reader["ZdrInozemstvo"];
			//entity.ZdrInozemstvo = (Convert.IsDBNull(reader["ZdrInozemstvo"]))?0:(System.Decimal?)reader["ZdrInozemstvo"];
			entity.UkNetoPredPosPorez = reader.IsDBNull(reader.GetOrdinal("UkNetoPredPosPorez")) ? null : (System.Decimal?)reader["UkNetoPredPosPorez"];
			//entity.UkNetoPredPosPorez = (Convert.IsDBNull(reader["UkNetoPredPosPorez"]))?0:(System.Decimal?)reader["UkNetoPredPosPorez"];
			entity.UkNetoIsplata = reader.IsDBNull(reader.GetOrdinal("UkNetoIsplata")) ? null : (System.Decimal?)reader["UkNetoIsplata"];
			//entity.UkNetoIsplata = (Convert.IsDBNull(reader["UkNetoIsplata"]))?0:(System.Decimal?)reader["UkNetoIsplata"];
			entity.UkPosPorez = reader.IsDBNull(reader.GetOrdinal("UkPosPorez")) ? null : (System.Decimal?)reader["UkPosPorez"];
			//entity.UkPosPorez = (Convert.IsDBNull(reader["UkPosPorez"]))?0:(System.Decimal?)reader["UkPosPorez"];
			entity.DatumIsplate = (System.DateTime)reader["DatumIsplate"];
			//entity.DatumIsplate = (Convert.IsDBNull(reader["DatumIsplate"]))?DateTime.MinValue:(System.DateTime)reader["DatumIsplate"];
			entity.DatumOd = (System.DateTime)reader["DatumOd"];
			//entity.DatumOd = (Convert.IsDBNull(reader["DatumOd"]))?DateTime.MinValue:(System.DateTime)reader["DatumOd"];
			entity.DatumDo = (System.DateTime)reader["DatumDo"];
			//entity.DatumDo = (Convert.IsDBNull(reader["DatumDo"]))?DateTime.MinValue:(System.DateTime)reader["DatumDo"];
			entity.RedniBrojUGodini = (System.Int32)reader["RedniBrojUGodini"];
			//entity.RedniBrojUGodini = (Convert.IsDBNull(reader["RedniBrojUGodini"]))?(int)0:(System.Int32)reader["RedniBrojUGodini"];
			entity.ObracunMjesec = reader.IsDBNull(reader.GetOrdinal("ObracunMjesec")) ? null : (System.Int32?)reader["ObracunMjesec"];
			//entity.ObracunMjesec = (Convert.IsDBNull(reader["ObracunMjesec"]))?(int)0:(System.Int32?)reader["ObracunMjesec"];
			entity.ObracunGodina = reader.IsDBNull(reader.GetOrdinal("ObracunGodina")) ? null : (System.Int32?)reader["ObracunGodina"];
			//entity.ObracunGodina = (Convert.IsDBNull(reader["ObracunGodina"]))?(int)0:(System.Int32?)reader["ObracunGodina"];
			entity.IsplataMjesec = reader.IsDBNull(reader.GetOrdinal("IsplataMjesec")) ? null : (System.Int32?)reader["IsplataMjesec"];
			//entity.IsplataMjesec = (Convert.IsDBNull(reader["IsplataMjesec"]))?(int)0:(System.Int32?)reader["IsplataMjesec"];
			entity.IsplataGodina = reader.IsDBNull(reader.GetOrdinal("IsplataGodina")) ? null : (System.Int32?)reader["IsplataGodina"];
			//entity.IsplataGodina = (Convert.IsDBNull(reader["IsplataGodina"]))?(int)0:(System.Int32?)reader["IsplataGodina"];
			entity.RSMSHA = reader.IsDBNull(reader.GetOrdinal("RSMSHA")) ? null : (System.String)reader["RSMSHA"];
			//entity.RSMSHA = (Convert.IsDBNull(reader["RSMSHA"]))?string.Empty:(System.String)reader["RSMSHA"];
			entity.BrojOsobaSPosPorezom = reader.IsDBNull(reader.GetOrdinal("BrojOsobaSPosPorezom")) ? null : (System.Int32?)reader["BrojOsobaSPosPorezom"];
			//entity.BrojOsobaSPosPorezom = (Convert.IsDBNull(reader["BrojOsobaSPosPorezom"]))?(int)0:(System.Int32?)reader["BrojOsobaSPosPorezom"];
			entity.PorOsnovicaPosPorez = reader.IsDBNull(reader.GetOrdinal("PorOsnovicaPosPorez")) ? null : (System.Decimal?)reader["PorOsnovicaPosPorez"];
			//entity.PorOsnovicaPosPorez = (Convert.IsDBNull(reader["PorOsnovicaPosPorez"]))?0:(System.Decimal?)reader["PorOsnovicaPosPorez"];
			reader.Close();
	
			entity.AcceptChanges();
		}
		
		/*
		/// <summary>
		/// Refreshes the <see cref="VwObracunZaID"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="VwObracunZaID"/> object.</param>
		protected static void RefreshEntity(DataSet dataSet, VwObracunZaID entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.IDObracun = (Convert.IsDBNull(dataRow["IDObracun"]))?(int)0:(System.Int32)dataRow["IDObracun"];
			entity.Naziv = (Convert.IsDBNull(dataRow["Naziv"]))?string.Empty:(System.String)dataRow["Naziv"];
			entity.Sjediste = (Convert.IsDBNull(dataRow["Sjediste"]))?string.Empty:(System.String)dataRow["Sjediste"];
			entity.IPPU = (Convert.IsDBNull(dataRow["IPPU"]))?string.Empty:(System.String)dataRow["IPPU"];
			entity.IBObveznika = (Convert.IsDBNull(dataRow["IBObveznika"]))?string.Empty:(System.String)dataRow["IBObveznika"];
			entity.IdentifikatorIDNaziv = (Convert.IsDBNull(dataRow["IdentifikatorIDNaziv"]))?string.Empty:(System.String)dataRow["IdentifikatorIDNaziv"];
			entity.IdentifikatorIDSifra = (Convert.IsDBNull(dataRow["IdentifikatorIDSifra"]))?string.Empty:(System.String)dataRow["IdentifikatorIDSifra"];
			entity.RSMVrstaObracunaOpis = (Convert.IsDBNull(dataRow["RSMVrstaObracunaOpis"]))?string.Empty:(System.String)dataRow["RSMVrstaObracunaOpis"];
			entity.RSMVrstaObracunaSifra = (Convert.IsDBNull(dataRow["RSMVrstaObracunaSifra"]))?string.Empty:(System.String)dataRow["RSMVrstaObracunaSifra"];
			entity.RSMVrstaObveznikaOpis = (Convert.IsDBNull(dataRow["RSMVrstaObveznikaOpis"]))?string.Empty:(System.String)dataRow["RSMVrstaObveznikaOpis"];
			entity.RSMVrstaObveznikaSifra = (Convert.IsDBNull(dataRow["RSMVrstaObveznikaSifra"]))?string.Empty:(System.String)dataRow["RSMVrstaObveznikaSifra"];
			entity.UkBrojStranica = (Convert.IsDBNull(dataRow["UkBrojStranica"]))?(long)0:(System.Int64?)dataRow["UkBrojStranica"];
			entity.UkBrojOsoba = (Convert.IsDBNull(dataRow["UkBrojOsoba"]))?(long)0:(System.Int64?)dataRow["UkBrojOsoba"];
			entity.IsplaceniPrimici = (Convert.IsDBNull(dataRow["IsplaceniPrimici"]))?0:(System.Decimal?)dataRow["IsplaceniPrimici"];
			entity.OsnovicaZaIzracundoprinosa = (Convert.IsDBNull(dataRow["OsnovicaZaIzracundoprinosa"]))?0:(System.Decimal?)dataRow["OsnovicaZaIzracundoprinosa"];
			entity.MIO1 = (Convert.IsDBNull(dataRow["MIO1"]))?0:(System.Decimal?)dataRow["MIO1"];
			entity.MIO2 = (Convert.IsDBNull(dataRow["MIO2"]))?0:(System.Decimal?)dataRow["MIO2"];
			entity.Dohodak = (Convert.IsDBNull(dataRow["Dohodak"]))?0:(System.Decimal?)dataRow["Dohodak"];
			entity.OsobniOdbici = (Convert.IsDBNull(dataRow["OsobniOdbici"]))?0:(System.Decimal?)dataRow["OsobniOdbici"];
			entity.PorOsnovica = (Convert.IsDBNull(dataRow["PorOsnovica"]))?0:(System.Decimal?)dataRow["PorOsnovica"];
			entity.ObracunatPorezIPrirez = (Convert.IsDBNull(dataRow["ObracunatPorezIPrirez"]))?0:(System.Decimal?)dataRow["ObracunatPorezIPrirez"];
			entity.ObracunatPorez = (Convert.IsDBNull(dataRow["ObracunatPorez"]))?0:(System.Decimal?)dataRow["ObracunatPorez"];
			entity.ObracunatPrirez = (Convert.IsDBNull(dataRow["ObracunatPrirez"]))?0:(System.Decimal?)dataRow["ObracunatPrirez"];
			entity.BrojRadnika = (Convert.IsDBNull(dataRow["BrojRadnika"]))?(int)0:(System.Int32?)dataRow["BrojRadnika"];
			entity.MIO1Osnovno = (Convert.IsDBNull(dataRow["MIO1Osnovno"]))?0:(System.Decimal?)dataRow["MIO1Osnovno"];
			entity.MIO1Povecano = (Convert.IsDBNull(dataRow["MIO1Povecano"]))?0:(System.Decimal?)dataRow["MIO1Povecano"];
			entity.MIO2Osnovno = (Convert.IsDBNull(dataRow["MIO2Osnovno"]))?0:(System.Decimal?)dataRow["MIO2Osnovno"];
			entity.MIO2Povecano = (Convert.IsDBNull(dataRow["MIO2Povecano"]))?0:(System.Decimal?)dataRow["MIO2Povecano"];
			entity.Zdrav = (Convert.IsDBNull(dataRow["Zdrav"]))?0:(System.Decimal?)dataRow["Zdrav"];
			entity.ZastitaNaRadu = (Convert.IsDBNull(dataRow["ZastitaNaRadu"]))?0:(System.Decimal?)dataRow["ZastitaNaRadu"];
			entity.Zaposljavanje = (Convert.IsDBNull(dataRow["Zaposljavanje"]))?0:(System.Decimal?)dataRow["Zaposljavanje"];
			entity.Invaliditet = (Convert.IsDBNull(dataRow["Invaliditet"]))?0:(System.Decimal?)dataRow["Invaliditet"];
			entity.ZdrInozemstvo = (Convert.IsDBNull(dataRow["ZdrInozemstvo"]))?0:(System.Decimal?)dataRow["ZdrInozemstvo"];
			entity.UkNetoPredPosPorez = (Convert.IsDBNull(dataRow["UkNetoPredPosPorez"]))?0:(System.Decimal?)dataRow["UkNetoPredPosPorez"];
			entity.UkNetoIsplata = (Convert.IsDBNull(dataRow["UkNetoIsplata"]))?0:(System.Decimal?)dataRow["UkNetoIsplata"];
			entity.UkPosPorez = (Convert.IsDBNull(dataRow["UkPosPorez"]))?0:(System.Decimal?)dataRow["UkPosPorez"];
			entity.DatumIsplate = (Convert.IsDBNull(dataRow["DatumIsplate"]))?DateTime.MinValue:(System.DateTime)dataRow["DatumIsplate"];
			entity.DatumOd = (Convert.IsDBNull(dataRow["DatumOd"]))?DateTime.MinValue:(System.DateTime)dataRow["DatumOd"];
			entity.DatumDo = (Convert.IsDBNull(dataRow["DatumDo"]))?DateTime.MinValue:(System.DateTime)dataRow["DatumDo"];
			entity.RedniBrojUGodini = (Convert.IsDBNull(dataRow["RedniBrojUGodini"]))?(int)0:(System.Int32)dataRow["RedniBrojUGodini"];
			entity.ObracunMjesec = (Convert.IsDBNull(dataRow["ObracunMjesec"]))?(int)0:(System.Int32?)dataRow["ObracunMjesec"];
			entity.ObracunGodina = (Convert.IsDBNull(dataRow["ObracunGodina"]))?(int)0:(System.Int32?)dataRow["ObracunGodina"];
			entity.IsplataMjesec = (Convert.IsDBNull(dataRow["IsplataMjesec"]))?(int)0:(System.Int32?)dataRow["IsplataMjesec"];
			entity.IsplataGodina = (Convert.IsDBNull(dataRow["IsplataGodina"]))?(int)0:(System.Int32?)dataRow["IsplataGodina"];
			entity.RSMSHA = (Convert.IsDBNull(dataRow["RSMSHA"]))?string.Empty:(System.String)dataRow["RSMSHA"];
			entity.BrojOsobaSPosPorezom = (Convert.IsDBNull(dataRow["BrojOsobaSPosPorezom"]))?(int)0:(System.Int32?)dataRow["BrojOsobaSPosPorezom"];
			entity.PorOsnovicaPosPorez = (Convert.IsDBNull(dataRow["PorOsnovicaPosPorez"]))?0:(System.Decimal?)dataRow["PorOsnovicaPosPorez"];
			entity.AcceptChanges();
		}
		*/
			
		#endregion Helper Functions
	}//end class

	#region VwObracunZaIDFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VwObracunZaID"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VwObracunZaIDFilterBuilder : SqlFilterBuilder<VwObracunZaIDColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VwObracunZaIDFilterBuilder class.
		/// </summary>
		public VwObracunZaIDFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the VwObracunZaIDFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public VwObracunZaIDFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the VwObracunZaIDFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public VwObracunZaIDFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion VwObracunZaIDFilterBuilder

	#region VwObracunZaIDParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VwObracunZaID"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VwObracunZaIDParameterBuilder : ParameterizedSqlFilterBuilder<VwObracunZaIDColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VwObracunZaIDParameterBuilder class.
		/// </summary>
		public VwObracunZaIDParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the VwObracunZaIDParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public VwObracunZaIDParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the VwObracunZaIDParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public VwObracunZaIDParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion VwObracunZaIDParameterBuilder
} // end namespace
